import java.util.Random;
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Text {
<<<<<<< HEAD
    public static void print(int n){
=======
      public static void print(int n){
>>>>>>> d5e1feba5b158f32749ae613585561f6f561937e
        if(n>10){
            print(n/10);
        }
        System.out.print(n%10);
        System.out.print(" ");
    }
    public static void main(String[] args) {

        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        print(n);
    }
<<<<<<< HEAD
    public static void main7(String[] args) {
=======
    public static void main8(String[] args) {
>>>>>>> d5e1feba5b158f32749ae613585561f6f561937e
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int i=0;
        int count=0;
        while(n>0){
            n=n&n-1;
            count++;
        }
        System.out.println(count);
    }
    public static void main6(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int i=0;
        int count=0;
        for(i=0;i<32;i++){
            if(((n>>i)&1)==1){
                count++;
            }
        }
        System.out.println(count);
    }
    public static void main4(String[] args) {
        double i=0.0;
        double sum=1.0;
        for(i=2;i<=100;i++) {
            if (i % 2 == 0) {
                sum += 1 / i;
            } else {
                sum -= 1 / i;
            }
        }
        System.out.println(sum);
    }
    public static void main3(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int i=0;
        int count=1;
        int sum=0;
        for(i=153;i<=n;i++) {
            int k = i;
            sum=0;
            count=1;
            while (k/10>0) {
                count++;
                k /= 10;
            }
            k = i;
            while (k > 0) {
                sum += Math.pow((k % 10), count);
                k/=10;
            }
            if (sum == i) {
                System.out.println(i);
            }
        }
        }


    public static void main1(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int i=0;
        int j=0;
        for(i=0;i<n;i++){
            for(j=0;j<n;j++){
                if((i+j==n-1)||j==i)
                {
                    System.out.print("*");
                }
                else{
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}
